home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / RKMLibsPrgs / intuition / screens / newlookscreen.c < prev    next >
C/C++ Source or Header  |  1992-09-03  |  3KB  |  83 lines

  1. ;/* newlookscreen.c - open a screen with the "new look".
  2. lc -b1 -cfist -v -y -j73 newlookscreen
  3. blink LIB:c.o newlookscreen.o TO newlookscreen LIB LIB:lc.lib LIB:amiga.lib
  4. quit
  5. */
  6.  
  7. /*
  8. Copyright (c) 1992 Commodore-Amiga, Inc.
  9.  
  10. This example is provided in electronic form by Commodore-Amiga, Inc. for
  11. use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  12. published by Addison-Wesley (ISBN 0-201-56774-1).
  13.  
  14. The "Amiga ROM Kernel Reference Manual: Libraries" contains additional
  15. information on the correct usage of the techniques and operating system
  16. functions presented in these examples.  The source and executable code
  17. of these examples may only be distributed in free electronic form, via
  18. bulletin board or as part of a fully non-commercial and freely
  19. redistributable diskette.  Both the source and executable code (including
  20. comments) must be included, without modification, in any copy.  This
  21. example may not be published in printed form or distributed with any
  22. commercial product.  However, the programming techniques and support
  23. routines set forth in these examples may be used in the development
  24. of original executable software products for Commodore Amiga computers.
  25.  
  26. All other rights reserved.
  27.  
  28. This example is provided "as-is" and is subject to change; no
  29. warranties are made.  All use is at your own risk. No liability or
  30. responsibility is assumed.
  31. */
  32.  
  33.  
  34. #define INTUI_V36_NAMES_ONLY
  35.  
  36. #include <exec/types.h>
  37. #include <intuition/intuition.h>
  38. #include <intuition/screens.h>
  39.  
  40. #include <clib/exec_protos.h>
  41. #include <clib/dos_protos.h>
  42. #include <clib/intuition_protos.h>
  43.  
  44. #ifdef LATTICE
  45. int CXBRK(void)    { return(0); }  /* Disable Lattice CTRL/C handling */
  46. int chkabort(void) { return(0); }  /* really */
  47. #endif
  48.  
  49. struct Library *IntuitionBase;
  50.  
  51. /* Simple routine to demonstrate opening a screen with the new look.
  52. ** Simply supply the tag SA_Pens along with a minimal pen specification,
  53. ** Intuition will fill in all unspecified values with defaults.
  54. ** Since we are not supplying values, all are Intuition defaults.
  55. */
  56. VOID main(int argc, char **argv)
  57. {
  58. UWORD pens[] = { ~0 };
  59. struct Screen *my_screen;
  60.  
  61. IntuitionBase = OpenLibrary("intuition.library",0);
  62. if (NULL != IntuitionBase)
  63.     {
  64.     if (IntuitionBase->lib_Version >= 37)
  65.         {
  66.         /* The screen is opened two bitplanes deep so that the
  67.         ** new look will show-up better.
  68.         */
  69.         if (NULL != (my_screen = OpenScreenTags(NULL,
  70.                                      SA_Pens, (ULONG)pens,
  71.                                      SA_Depth, 2,
  72.                                      TAG_DONE)))
  73.             {
  74.             /* screen successfully opened */
  75.             Delay(30L);  /* normally the program would be here */
  76.  
  77.             CloseScreen(my_screen);
  78.             }
  79.         }
  80.     CloseLibrary(IntuitionBase);
  81.     }
  82. }
  83.